import { createRouter, createWebHistory, createWebHashHistory, RouteRecordRaw } from "vue-router";

const routes: RouteRecordRaw[] = [
    { path: '/', redirect: "/index" },
    {
        path: '/index',
        component: () => import('@/views/index.vue'),
        meta: { title: '首页' },
    },
    {
        path: '/detail',
        name: "detail",
        component: () => import('@/views/detail.vue'),
    },
    {
        path: '/goods-list',
        name: 'goods-list',
        component: () => import('@/views/goods-list.vue'),
    },
    {
        path: '/form-demo',
        name: 'form-demo',
        component: () => import('@/views/form-demo.vue'),
    },
    {
        path: '/chart-revenue',
        name: 'chart-renvenue',
        component: () => import('@/views/chart-revenue.vue'),
    },
    {
        path: '/test',
        name: 'test',
        component: () => import('@/views/test.vue'),
    },
]
const router = createRouter({
    history: createWebHistory(),
    routes: routes,
})
router.beforeEach((to, from, next) => {
    console.log('goto', to, from);
    next();
});
export default router